package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Doffer {
    private int offerId;
    private Dbusiness business;
    private String offerTheme;
    private String offerNumbers;
    private BigDecimal offerMoney;
    private Integer offerStatu;
    private String offerNote;
    private String offerPeople;
    private BigDecimal offerProfit;
    private Timestamp offerTime;
    private String offerAudit;
    private String offerAccept;
    private QempFrom offerExamine;
    private TfyclientForm client;
    private TfylinkmanForm busPrimarycontact;
    private Collection<Dofferdetails> offerList;


    @Id
    @Column(name = "offer_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "doffer")
    public int getOfferId() {
        return offerId;
    }

    public void setOfferId(int offerId) {
        this.offerId = offerId;
    }


    @ManyToOne
    @JoinColumn(name = "bus_id",referencedColumnName = "bus_id")
    public Dbusiness getBusiness() {
        return business;
    }

    public void setBusiness(Dbusiness business) {
        this.business = business;
    }


    @Basic
    @Column(name = "offer_theme")
    public String getOfferTheme() {
        return offerTheme;
    }

    public void setOfferTheme(String offerTheme) {
        this.offerTheme = offerTheme;
    }

    @Basic
    @Column(name = "offer_numbers")
    public String getOfferNumbers() {
        return offerNumbers;
    }

    public void setOfferNumbers(String offerNumbers) {
        this.offerNumbers = offerNumbers;
    }

    @Basic
    @Column(name = "offer_money")
    public BigDecimal getOfferMoney() {
        return offerMoney;
    }

    public void setOfferMoney(BigDecimal offerMoney) {
        this.offerMoney = offerMoney;
    }

    @Basic
    @Column(name = "offer_statu")
    public Integer getOfferStatu() {
        return offerStatu;
    }

    public void setOfferStatu(Integer offerStatu) {
        this.offerStatu = offerStatu;
    }

    @Basic
    @Column(name = "offer_note")
    public String getOfferNote() {
        return offerNote;
    }

    public void setOfferNote(String offerNote) {
        this.offerNote = offerNote;
    }

    @Basic
    @Column(name = "offer_people")
    public String getOfferPeople() {
        return offerPeople;
    }

    public void setOfferPeople(String offerPeople) {
        this.offerPeople = offerPeople;
    }

    @Basic
    @Column(name = "offer_profit")
    public BigDecimal getOfferProfit() {
        return offerProfit;
    }

    public void setOfferProfit(BigDecimal offerProfit) {
        this.offerProfit = offerProfit;
    }

    @Basic
    @Column(name = "offer_time")
    public Timestamp getOfferTime() {
        return offerTime;
    }

    public void setOfferTime(Timestamp offerTime) {
        this.offerTime = offerTime;
    }


    @Basic
    @Column(name = "offer_audit")
    public String getOfferAudit() {
        return offerAudit;
    }

    public void setOfferAudit(String offerAudit) {
        this.offerAudit = offerAudit;
    }


    @Basic
    @Column(name = "offer_accept")
    public String getOfferAccept() {
        return offerAccept;
    }

    public void setOfferAccept(String offerAccept) {
        this.offerAccept = offerAccept;
    }


    @ManyToOne
    @JoinColumn(name = "offer_examine",referencedColumnName = "emp_id")
    public QempFrom getOfferExamine() {
        return offerExamine;
    }

    public void setOfferExamine(QempFrom offerExamine) {
        this.offerExamine = offerExamine;
    }

    @ManyToOne
    @JoinColumn(name = "client_id",referencedColumnName = "client_id")
    public TfyclientForm getClient() {
        return client;
    }

    public void setClient(TfyclientForm client) {
        this.client = client;
    }

    @ManyToOne
    @JoinColumn(name = "linkman_id",referencedColumnName = "linkman_id")
    public TfylinkmanForm getBusPrimarycontact() {
        return busPrimarycontact;
    }

    public void setBusPrimarycontact(TfylinkmanForm busPrimarycontact) {
        this.busPrimarycontact = busPrimarycontact;
    }


    @OneToMany(mappedBy = "offerId")
    public Collection<Dofferdetails> getOfferList() {
        return offerList;
    }

    public void setOfferList(Collection<Dofferdetails> offerList) {
        this.offerList = offerList;
    }


    @Override
    public String toString() {
        return "Doffer{" +
                "offerId=" + offerId +
                ", offerExamine=" + offerExamine +
                '}';
    }
}
